package cn.cheln.explorer.ds.sdcard;

import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class TypeFilter
  implements FileFilter
{
  public static final int FILTER_BOTH_DIR_FILE = 4;
  public static final int FILTER_REMOVE_HIDDEN = 0;
  public static final int FILTER_RETAIN_DIRECTORY = 1;
  public static final int FILTER_RETAIN_FILE = 2;
  public List<TextWrapper> excludeExamples = new ArrayList();
  public List<Integer> filter_mode = new ArrayList();
  public List<String> includeExamples = new ArrayList();

  public TypeFilter(Integer[] paramArrayOfInteger, TextWrapper[] paramArrayOfTextWrapper, String[] paramArrayOfString)
  {
    if (paramArrayOfInteger != null)
      this.filter_mode = Arrays.asList(paramArrayOfInteger);
    if (paramArrayOfTextWrapper != null)
      this.excludeExamples = Arrays.asList(paramArrayOfTextWrapper);
    if (paramArrayOfString == null)
      return;
    this.includeExamples = Arrays.asList(paramArrayOfString);
  }

  public boolean accept(File paramFile)
  {
    return filter(paramFile);
  }

  public boolean filter(File paramFile)
  {
    if (this.excludeExamples == null);
    while (true)
    {
      return true;
      if (this.excludeExamples.contains(new TextWrapper(paramFile)))
        return false;
      if ((((this.filter_mode.contains(Integer.valueOf(4))) || (this.filter_mode.contains(Integer.valueOf(1))))) && (paramFile.isDirectory()))
      {
        if ((!(this.filter_mode.contains(Integer.valueOf(0)))) || (!(paramFile.isHidden())))
          continue;
        if (this.includeExamples == null)
          return false;
        if (!(this.includeExamples.contains(paramFile.getAbsolutePath())));
        return false;
      }
      if ((((this.filter_mode.contains(Integer.valueOf(2))) || (this.filter_mode.contains(Integer.valueOf(4))))) && (paramFile.isFile()))
      {
        if ((this.filter_mode.contains(Integer.valueOf(0))) && (paramFile.isHidden()));
        return false;
      }
      if (!(this.filter_mode.contains(Integer.valueOf(0))))
        break;
      if (paramFile.isHidden())
        return false;
    }
    return false;
  }

  public void setMode(Integer[] paramArrayOfInteger, TextWrapper[] paramArrayOfTextWrapper)
  {
    if (paramArrayOfInteger != null)
      this.filter_mode = Arrays.asList(paramArrayOfInteger);
    if (paramArrayOfTextWrapper == null)
      return;
    this.excludeExamples = Arrays.asList(paramArrayOfTextWrapper);
  }

  public static class TextWrapper
  {
    List list;
    String str;
    File wrapper;

    public TextWrapper(File paramFile)
    {
      this.wrapper = paramFile;
    }

    public TextWrapper(String paramString)
    {
      this.str = paramString;
    }

    public boolean equals(Object paramObject)
    {
      TextWrapper localTextWrapper;
      if (this == paramObject);
      do
      {
        return true;
        if (paramObject == null)
          return false;
        localTextWrapper = (TextWrapper)paramObject;
        this.list = Arrays.asList(this.wrapper.getAbsolutePath().split("/"));
      }
      while (this.list.contains(localTextWrapper.str));
      return false;
    }
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     cn.cheln.explorer.ds.sdcard.TypeFilter
 * JD-Core Version:    0.5.2
 */